import os,csv

# 获取文件夹下所有文件路径
def get_file_paths(directory):
    file_paths = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            temp=os.path.join(root, file)
            file_paths.append(temp.replace('\\','/'))
    return file_paths

# 格式化数字为4位
def format_number_four_chars(number):
    return "{:04d}".format(number)

# 获取文件夹下所有文件名
def get_all_names(directory):
    filenames = []
    for root, dirs, files in os.walk(directory):
        for file in files:
            name=os.path.splitext(file)[0]
            filenames.append(name)
    return filenames

def read_csv_file(file_path):
    arr=[]
    i=0
    with open(file_path, mode='r', encoding='utf-8') as csvfile:
        csv_reader = csv.reader(csvfile)
        for row in csv_reader:
            if i>0:
                value=row[2]+row[1]
                arr.append(value.replace('\\','/'))
            i+=1
    return arr